package ooday02;
/** 方法重写的演示 */
public class OverrideDemo {
    public static void main(String[] args) {
        //重写方法被调用时，看对象类型(new谁就调用谁)
        Student zg = new Student("张光",20,"银川市","jsd2408","001");
        zg.sayHi();

        Teacher ll = new Teacher("李琳",21,"宁夏省",8000.0);
        ll.sayHi();

        Doctor jj = new Doctor("王海",24,"光禄寺","光禄大夫");
        jj.sayHi();
    }
}       //重写方法被调用时，看对象的类型 new谁就调用谁
